<?php
class Action extends AppModel {
	var $name = 'Action';
	var $displayField = 'action_type';
	//The Associations below have been created with all possible keys, those that are not needed can be removed

	var $belongsTo = array(
		'Actiontype' => array(
			'className' => 'Actiontype',
			'foreignKey' => 'actiontype_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Dmdform' => array(
			'className' => 'Dmdform',
			'foreignKey' => 'dmdform_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Dmdformstatus' => array(
			'className' => 'Dmdformstatus',
			'foreignKey' => 'dmdformstatus_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'User' => array(
			'className' => 'User',
			'foreignKey' => 'action_by',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);
        function createAction($type,$dmdId,$by,$dmdCode,$dmdstatus){
            $this->create();
            $data['Action']['actiontype_id']=$type;
            $data['Action']['action_by']=$by;
            $data['Action']['dmdform_id']=$dmdId;
            $data['Action']['dmdformstatus_id']=$dmdstatus;
            $data['Action']['notes']=  $dmdCode;
            $this->save($data);
        }
}
?>